

import service  from "@/utils/request";
/**
 * 新增银行卡
 * @param { string } bankCardNumber  银行卡号
 * @param { string } bankName  银行卡号
 * @param { string } id  银行卡号
 * @param { string } name  银行卡号
 */
export function addCard(data = {}) {
  return service({
    url: "/web/bankCard/add",
    method: "post",
    data,
  });
}

/**
 * 银行卡列表
 */
export function getCardList(params = {}) {
  return service({
    url: "/web/bankCard/list",
    method: "get",
    params,
  });
}

/**
 * 删除银行卡
 */
 export function delCard(ids = "") {
  return service({
    url: "/web/bankCard/del/" + ids,
    method: "get",
  });
}

/**
 * 获取银行卡类型
 */
 export function getBackType(ids = "") {
  return service({
    url: "/web/bankCard/type/list" + ids,
    method: "get",
  });
}

/**
 * 修改银行卡
 */
 export function editCard(data) {
  return service({
    url: "/web/bankCard/edit",
    method: "post",
    data
  });
}


/**
 * 提现
 * @param { string } bankCardId  银行卡ID
 * @param { string } money  提现金额
 * @param { string } payPass  交易密码
 */
export function withdraw(params) {
  return service({
    url: "/web/wallet/withdrawal",
    method: "post",
    // headers: {
    //   'Content-Type': 'application/x-www-form-urlencoded'
    // },
    params
  });
}

/**
 * 获取用户余额
 * @param {*} data 
 * @returns 
 */
export function getUserBalance(data) {
  return service({
    url: "/web/wallet/getUserBalance",
    method: "get",
    data
  });
}

/**
 * 获取用户积分
 * @param {*} data 
 * @returns 
 */
 export function getUserIntegral(params) {
  return service({
    url: "/web/integral/getUserIntegral",
    method: "get",
    params
  });
}

/**
 * 获取积分收入明细 
 * @param {*} data 
 * @returns 
 */
 export function getIntegralLog(params) {
  return service({
    url: "/web/integral/getIntegralLog",
    method: "get",
    params
  });
}

/**
 * 获取积分兑换金额比例
 * @param {*} data 
 * @returns 
 */
 export function getIntegralRatio(params) {
  return service({
    url: "/web/integral/getIntegralRatio",
    method: "get",
    params
  });
}

/**
 * 积分兑换金额
 * @param {*} data 
 * @returns 
 */
 export function exchangeMoney(money) {
  return service({
    url: "/web/integral/exchangeMoney/" + money,
    method: "get",
    params: {
      money
    }
  });
}

/**
 * 添加身份认证
 * @param {string} certificateBackUrl  证件背面照
 * @param {string} certificateFrontUrl  证件前面	
 * @param {string} handheldFrontUrl  手持正面
 * @param {string} idNumber  证件号码	
 * @param {string} name  名	
 * @param {string} surname  姓
 * @returns 
 */
 export function addAuth(data) {
  return service({
    url: "/web/authentication/add",
    method: "post",
    data
  });
}
/**
 * 修改身份认证
 * @param {string} id  id
 * @param {string} certificateBackUrl  证件背面照
 * @param {string} certificateFrontUrl  证件前面	
 * @param {string} handheldFrontUrl  手持正面
 * @param {string} idNumber  证件号码	
 * @param {string} name  名	
 * @param {string} surname  姓
 * @returns 
 */
 export function editAuth(data) {
  return service({
    url: "/web/authentication/edit",
    method: "post",
    data
  });
}
/**
 * 获取身份认证

 */
 export function getAuthInfo(data) {
  return service({
    url: "/web/authentication/getInfo",
    method: "get",
    data
  });
}

/**
 * 获取提现记录
 */
 export function getWithdrawalRecord(status = -1) {
  return service({
    url: "/web/wallet/getWithdrawalRecord/" + status,
    method: "get"
  });
}

/**
 * 清除认证信息
 */
 export function clearInfo(params) {
  return service({
    url: "/web/authentication/clearInfo",
    method: "get",
    params
  });
}

/**
 * 余额明细
 */
 export function transactionDetail(type) {
  return service({
    url: "/web/wallet/transactionDetail/" + type,
    method: "get",
    // params: {
    //   type
    // },
    // headers: {
    //   'Content-Type': 'application/x-www-form-urlencoded'
    // },
  });
}
